/**************************************************************************//**
 * @file     pan_phy.h
 * @version  V1.00
 * $Date: 20/12/14 14:50 $ 
 * @brief    Panchip rf driver header file
 *
 * @note
 * Copyright (C) 2020 Panchip Technology Corp. All rights reserved.
 *****************************************************************************/ 
#ifndef __PRI_RHY_H__
#define __PRI_RHY_H__

#ifdef __cplusplus
extern "C"
{
#endif

/* Supported PHYs*/
enum tx_rx_phy
{
    LE_NO_CHANGE    = 0x00,
    LE_1M           = 0x01,
    LE_2M           = 0x02,
    LE_CODED_S8     = 0x03,
    LE_CODED        = 0x04
};

/**
  * @brief  Reset phy.
  * @brief  (ZH) phy复位.
  * @retval None
  * @retval (ZH) 无
  */
void PHY_reset(void);

/**
  * @brief  Configures the channel.
  * @brief  (ZH) 设置频点配置信息.
  * @param  chan: channel num
  * @param  (ZH) chan: 频点选择: 
  * @retval None
  * @retval (ZH) 无
  */
void PHY_SetChConfig(uint8_t chan);

/**
  * @brief  Phy init.
  * @brief  (ZH) phy初始化.
  * @retval None
  * @retval (ZH) 无
  */
void PHY_init(void);

/**
  * @brief  Gonfigures the send and receive sequence.
  * @brief  (ZH) 设置发送接收配置.
  * @param  phy: select phy
  * @param  (ZH) phy: phy选择
  * @retval None
  * @retval (ZH) 无
  */
void PHY_SetTrxSeq(enum tx_rx_phy phy);

/**
  * @brief  Gonfigures the send and receive time.
  * @brief  (ZH) 设置发送接收转换时间.
  * @param  phy: select phy
  * @param  (ZH) phy: phy选择
  * @param  tx1rx0: select tx or rx mode
  * @param  (ZH) tx1rx0: 发送或接收模式选择
  * @retval None
  * @retval (ZH) 无
  */
uint8_t phy_set_time_cfg(uint8_t phy, uint8_t tx1rx0);

/* filter_start: unnormalised driver,used for 2.3G or 2.5G */
/**
  * @brief  Configures the Low Speed AHB clock (HCLK).
  * @brief  (ZH) 设置非常规的频点信息.
  * @param  rf_channel: channel number
  * @param  (ZH) rf_channel: 频点选择
  * @param  calibrate: Whether calibration is required，1(need)：0(no need)
  * @param  (ZH) calibrate: 是否需要校准，1需要：0不需要
  * @retval true or false
  * @retval (ZH) 真或假
  */
bool PHY_SetExternChannel(uint16_t rf_channel, uint8_t calibrate);
/* filter_end: unnormalised driver,used for 2.3G or 2.5G */

#ifdef __cplusplus
}
#endif

#endif //__PRI_RHY_H__

/*** (C) COPYRIGHT 2016 Panchip Technology Corp. ***/
